/*
 * 文件名：ProtocalSdtpAcceptHandler.java
 * 版权：亚信联创版权所有
 * 描述：TODO
 * 修改人：xuwei3
 * 修改时间：2015-5-20
 * 修改内容：TODO
 */
package com.ailk.bigdata.etl.realstream.server.protocal.sdtp.disruptor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ailk.bigdata.etl.realstream.server.model.SdtpValueEvent;
import com.ailk.bigdata.etl.realstream.server.monitor.EventCounter;
import com.lmax.disruptor.WorkHandler;

/**
 * @description TODO
 * @author [xuwei3]
 * @version [版本号,2015-5-20]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class SdtpAcceptedDisruptorHandler implements WorkHandler<SdtpValueEvent>
{
	private static Logger logger = LoggerFactory.getLogger(SdtpAcceptedDisruptorHandler.class);
	private EventCounter eventCounter;

	public SdtpAcceptedDisruptorHandler(EventCounter eventCounter)
	{
		super();
		this.eventCounter = eventCounter;
	}

	/**
	 * @see com.lmax.disruptor.WorkHandler#onEvent(java.lang.Object)
	 */
	@Override
	public void onEvent(SdtpValueEvent value) throws Exception
	{
		
		logger.info("接收到的消息内容是：" + value.getDataPackage().getDataContent().toString());
		eventCounter.incrementEventSendedCount();
	}

}
